<?php

/**
 * versions actions.
 *
 * @package    TB
 * @subpackage versions
 * @author     Marion Duprey
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class versionsActions extends sfActions {
/**
 * Executes index action
 *
 * @param sfRequest $request A request object
 */
    public function executeIndex(sfWebRequest $request) {
	// 404 si le TU n'existe pas dans la base
	$this->forward404Unless($this->tu = TuPeer::retrieveByPK($request->getParameter('id')));
	// récupération des versions et dates correspondantes
	$criteria = new Criteria();
	$criteria->add(DateVersionPeer::TU_ID, $request->getParameter('id'));
	$criteria->addDescendingOrderByColumn("created_at");
	$this->tab_version = DateVersionPeer::doSelect($criteria);
    }
}
